/// Determine the length of the collatz sequence beginning at `n`.
fn collatz_length(mut n: i32) -> u32 {
    let mut i = 1;
    while n != 1 {
        n = if n % 2 == 0 { n / 2 } else { n * 3 + 1 };
        i += 1;
    }
    return i;
}

#[test]
fn test() {
    assert_eq!(collatz_length(11), 15);
}